package com.dzsw.simple.server.controller;


import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/sc")
public class Es6FetchController {

    @GetMapping("/get")
    public Map<String, Object> getMethod() {
        return new HashMap<>() {{
            put("id", "10001");
            put("name", "王晓辉");
        }};
    }

    @PostMapping("/post/form")
    public Map<String, Object> postForm(@RequestParam String annexId,
                                              @RequestParam String bizId) {
        return new HashMap<>() {{
            put("message", "success");
            put("annexId", annexId);
            put("bizId", bizId);
        }};
    }

    @PostMapping("/post/body")
    public Map<String, Object> postBody(@RequestBody Map<String, String> paramMap) {
        return new HashMap<>() {{
            put("message", "success");
            putAll(paramMap);
        }};
    }
}
